@layout("/common/_container.html"){
<div class="margin-15" id="editUserPage">
    <form class="layui-form layui-form-pane" lay-filter="userEditForm">
        <input type="hidden" name="id" value="${user.id}"/>
        <div class="layui-form-item">
            <label class="layui-form-label">账号</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" name="username" lay-verify="required|username" autocomplete="off"
                       value="${user.username}"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-block">
                <input type="text" name="realName" required lay-verify="required|realName" autocomplete="off"
                       class="layui-input" value="${user.realName}"/>
            </div>
        </div>

        <div class="layui-form-item" pane>
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block">
                <input type="radio" name="sex" value="1" title="男" ${user.sex==1?"checked":""}/>
                <input type="radio" name="sex" value="2" title="女" ${user.sex==2?"checked":""}/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">生日</label>
            <div class="layui-input-block">
                <input type="text" id="birthday" name="birthday" autocomplete="off" class="layui-input"
                       value="${user.birthday,dateFormat='yyyy-MM-dd'}"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">电子邮件</label>
            <div class="layui-input-block">
                <input type="text" name="email" autocomplete="off" class="layui-input" value="${user.email}"
                       lay-verify="required|email"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">手机号</label>
            <div class="layui-input-block">
                <input type="text" name="mobile" lay-verify="required|phone" autocomplete="off" class="layui-input" value="${user.mobile}"/>
            </div>
        </div>

        <div class="layui-form-item pane">
            <label class="layui-form-label">部门</label>
            <div class="layui-input-block">
                <input type="hidden" name="deptId" value="${user.deptId}"/>
                <a href="javascript:void(0);" class="layui-btn" id="chooseDepartment">${user.departmentName!"选择部门"}</a>
            </div>
        </div>

        <div class="layui-form-item" pane>
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="radio" name="status" value="1" title="启用" ${user.status==1?"checked":""}/>
                <input type="radio" name="status" value="0" title="停用" ${user.status==0?"checked":""}/>
            </div>
        </div>

        <div class="layui-form-item" pane>
            <label class="layui-form-label">角色</label>
            <div class="layui-input-block">
                @for(role in roleList){
                <input type="checkbox" name="roleId" value="${role.id}" title="${role.roleName}"
                       ${array.contain(roles,role.id+"")?"checked":""}/>
                @}
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="editUser">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>

<script src="${ctxPath}/static/scripts/system/user.js"></script>
@}
